package com.fwixvye.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.LinkedHashMap;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Role {

    //角色名字
    public String name;

    //生命值
    public double hp_b = 0;
    public double hp_p = 0;
    public double hp_r = 0;
    public double hp_f = 0;
    public double hp_t = 0;

    public void addHp_p(double hp_p) {
        this.hp_p += hp_p;
        this.hp_t = hp_b + hp_b * hp_p + hp_r;
    }

    public void addHp_r(double hp_r) {
        this.hp_r += hp_r;
        this.hp_t = hp_b + hp_b * hp_p + hp_r;
    }

    //攻击力
    public double atk_b = 0;
    public double atk_p = 0;
    public double atk_r = 0;
    public double atk_f = 0;
    public double atk_t = 0;

    public void addAtk_p(double atk_p) {
        this.atk_p += atk_p;
        this.atk_t = atk_b + atk_b * atk_p + atk_r;
    }

    public void addAtk_r(double atk_r) {
        this.atk_r += atk_r;
        this.atk_t = atk_b + atk_b * atk_p + atk_r;
    }

    //防御力
    public double def_b = 0;
    public double def_p = 0;
    public double def_r = 0;
    public double def_f = 0;
    public double def_t = 0;

    public void addDef_p(double def_p) {
        this.def_p += def_p;
        this.def_t = def_b + def_b * def_p + def_r;
    }

    public void addDef_r(double def_r) {
        this.def_r += def_r;
        this.def_t = def_b + def_b * def_p + def_r;
    }

    //元素精通
    public double em_b = 0;
    public double em_p = 0;
    public double em_r = 0;
    public double em_t = 0;

    public void addEm_p(double em_p) {
        this.em_p += em_p;
        this.em_t = em_b + em_b * em_p + em_r;
    }

    public void addEm_r(double em_r) {
        this.em_r += em_r;
        this.em_t = em_b + em_b * em_p + em_r;
    }

    //体力
    public double ms_b = 0;
    public double ms_p = 0;
    public double ms_r = 0;
    public double ms_t = 0;

    public void addMs_p(double ms_p) {
        this.ms_p += ms_p;
        this.ms_t = ms_b + ms_b * ms_p + ms_r;
    }

    public void addMs_r(double ms_r) {
        this.ms_r += ms_r;
        this.ms_t = ms_b + ms_b * ms_p + ms_r;
    }

    //突破属性
    public double as_b = 0; //突破属性数值
    public int as_t = 0; //突破类型数值

    //暴击率
    public double crr_b = 0.05;
    public double crr_p = 0;
    public double crr_r = 0;
    public double crr_t = 0.05;

    public void addCrr_p(double crr_p) {
        this.crr_p += crr_p;
        this.crr_t = crr_b + crr_b * crr_p + crr_r;
    }

    public void addCrr_r(double crr_r) {
        this.crr_r += crr_r;
        this.crr_t = crr_b + crr_b * crr_p + crr_r;
    }

    //暴击伤害
    public double crd_b = 0.5;
    public double crd_p = 0;
    public double crd_r = 0;
    public double crd_t = 0.5;

    public void addCrd_p(double crd_p) {
        this.crd_p += crd_p;
        this.crd_t = crd_b + crd_b * crd_p + crd_r;
    }

    public void addCrd_r(double crd_r) {
        this.crd_r += crd_r;
        this.crd_t = crd_b + crd_b * crd_p + crd_r;
    }

    //治疗加成
    public double hb_b = 0;
    public double hb_p = 0;
    public double hb_r = 0;
    public double hb_t = 0;

    public void addHb_p(double hb_p) {
        this.hb_p += hb_p;
        this.hb_t = hb_b + hb_b * hb_p + hb_r;
    }

    public void addHb_r(double hb_r) {
        this.hb_r += hb_r;
        this.hb_t = hb_b + hb_b * hb_p + hb_r;
    }

    //受治疗加成
    public double ihb_b = 0;
    public double ihb_p = 0;
    public double ihb_r = 0;
    public double ihb_t = 0;

    public void addIhb_p(double ihb_p) {
        this.ihb_p += ihb_p;
        this.ihb_t = ihb_b + ihb_b * ihb_p + ihb_r;
    }

    public void addIhb_r(double ihb_r) {
        this.ihb_r += ihb_r;
        this.ihb_t = ihb_b + ihb_b * ihb_p + ihb_r;
    }

    //元素充能效率
    public double er_b = 1;
    public double er_p = 0;
    public double er_r = 0;
    public double er_t = 1;

    public void addEr_p(double er_p) {
        this.er_p += er_p;
        this.er_t = er_b + er_b * er_p + er_r;
    }

    public void addEr_r(double er_r) {
        this.er_r += er_r;
        this.er_t = er_b + er_b * er_p + er_r;
    }

    //冷却缩减
    public double cdr_b = 0;
    public double cdr_p = 0;
    public double cdr_r = 0;
    public double cdr_t = 0;

    public void addCdr_p(double cdr_p) {
        this.cdr_p += cdr_p;
        this.cdr_t = cdr_b + cdr_b * cdr_p + cdr_r;
    }

    public void addCdr_r(double cdr_r) {
        this.cdr_r += cdr_r;
        this.cdr_t = cdr_b + cdr_b * cdr_p + cdr_r;
    }

    //护盾强效
    public double ss_b = 0;
    public double ss_p = 0;
    public double ss_r = 0;
    public double ss_t = 0;

    public void addSs_p(double ss_p) {
        this.ss_p += ss_p;
        this.ss_t = ss_b + ss_b * ss_p + ss_r;
    }

    public void addSs_r(double ss_r) {
        this.ss_r += ss_r;
        this.ss_t = ss_b + ss_b * ss_p + ss_r;
    }

    //元素属性
    public double et_b = 0;
    public double et_p = 0;
    public double et_r = 0;
    public double et_t = 0;

    public void addEt_p(double et_p) {
        this.et_p += et_p;
        this.et_t = et_b + et_b * et_p + et_r;
    }

    public void addEt_r(double et_r) {
        this.et_r += et_r;
        this.et_t = et_b + et_b * et_p + et_r;
    }

    //火伤
    public double hsjc_b = 0;
    public double hsjc_p = 0;
    public double hsjc_r = 0;
    public double hsjc_t = 0;

    public void addHsjc_p(double hsjc_p) {
        this.hsjc_p += hsjc_p;
        this.hsjc_t = hsjc_b + hsjc_b * hsjc_p + hsjc_r;
    }

    public void addHsjc_r(double hsjc_r) {
        this.hsjc_r += hsjc_r;
        this.hsjc_t = hsjc_b + hsjc_b * hsjc_p + hsjc_r;
    }

    //水伤
    public double ssjc_b = 0;
    public double ssjc_p = 0;
    public double ssjc_r = 0;
    public double ssjc_t = 0;

    public void addSsjc_p(double ssjc_p) {
        this.ssjc_p += ssjc_p;
        this.ssjc_t = ssjc_b + ssjc_b * ssjc_p + ssjc_r;
    }

    public void addSsjc_r(double ssjc_r) {
        this.ssjc_r += ssjc_r;
        this.ssjc_t = ssjc_b + ssjc_b * ssjc_p + ssjc_r;
    }

    //风伤
    public double fsjc_b = 0;
    public double fsjc_p = 0;
    public double fsjc_r = 0;
    public double fsjc_t = 0;

    public void addFsjc_p(double fsjc_p) {
        this.fsjc_p += fsjc_p;
        this.fsjc_t = fsjc_b + fsjc_b * fsjc_p + fsjc_r;
    }

    public void addFsjc_r(double fsjc_r) {
        this.fsjc_r += fsjc_r;
        this.fsjc_t = fsjc_b + fsjc_b * fsjc_p + fsjc_r;
    }

    //雷伤
    public double lsjc_b = 0;
    public double lsjc_p = 0;
    public double lsjc_r = 0;
    public double lsjc_t = 0;

    public void addLsjc_p(double lsjc_p) {
        this.lsjc_p += lsjc_p;
        this.lsjc_t = lsjc_b + lsjc_b * lsjc_p + lsjc_r;
    }

    public void addLsjc_r(double lsjc_r) {
        this.lsjc_r += lsjc_r;
        this.lsjc_t = lsjc_b + lsjc_b * lsjc_p + lsjc_r;
    }

    //草伤
    public double csjc_b = 0;
    public double csjc_p = 0;
    public double csjc_r = 0;
    public double csjc_t = 0;

    public void addCsjc_p(double csjc_p) {
        this.csjc_p += csjc_p;
        this.csjc_t = csjc_b + csjc_b * csjc_p + csjc_r;
    }

    public void addCsjc_r(double csjc_r) {
        this.csjc_r += csjc_r;
        this.csjc_t = csjc_b + csjc_b * csjc_p + csjc_r;
    }

    //冰伤
    public double bsjc_b = 0;
    public double bsjc_p = 0;
    public double bsjc_r = 0;
    public double bsjc_t = 0;

    public void addBsjc_p(double bsjc_p) {
        this.bsjc_p += bsjc_p;
        this.bsjc_t = bsjc_b + bsjc_b * bsjc_p + bsjc_r;
    }

    public void addBsjc_r(double bsjc_r) {
        this.bsjc_r += bsjc_r;
        this.bsjc_t = bsjc_b + bsjc_b * bsjc_p + bsjc_r;
    }

    //岩伤
    public double ysjc_b = 0;
    public double ysjc_p = 0;
    public double ysjc_r = 0;
    public double ysjc_t = 0;

    public void addYsjc_p(double ysjc_p) {
        this.ysjc_p += ysjc_p;
        this.ysjc_t = ysjc_b + ysjc_b * ysjc_p + ysjc_r;
    }

    public void addYsjc_r(double ysjc_r) {
        this.ysjc_r += ysjc_r;
        this.ysjc_t = ysjc_b + ysjc_b * ysjc_p + ysjc_r;
    }

    //物伤
    public double wsjc_b = 0;
    public double wsjc_p = 0;
    public double wsjc_r = 0;
    public double wsjc_t = 0;

    public void addWsjc_p(double wsjc_p) {
        this.wsjc_p += wsjc_p;
        this.wsjc_t = wsjc_t + wsjc_b * wsjc_p + wsjc_r;
    }

    public void addWsjc_r(double wsjc_r) {
        this.wsjc_r += wsjc_r;
        this.wsjc_t = wsjc_t + wsjc_b * wsjc_p + wsjc_r;
    }

    //武器副词条加成
    public void weaponAdverbAddition(Weapon weapon) {
        Integer secEntryType = weapon.getSecEntryType();
        switch (secEntryType) {
            case 3: {
                hp_p += weapon.getSecEntry();
                break;
            }
            case 4: {
                atk_p += weapon.getSecEntry();
                break;
            }
            case 5: {
                def_p += weapon.getSecEntry();
                break;
            }
            case 6: {
                em_r += weapon.getSecEntry();
                break;
            }
            case 7: {
                er_r += weapon.getSecEntry();
                break;
            }
            case 15: {
                wsjc_r += weapon.getSecEntry();
                break;
            }
            case 16: {
                crr_r += weapon.getSecEntry();
                break;
            }
            case 17: {
                crd_r += weapon.getSecEntry();
                break;
            }

        }
    }

    //圣遗物二件套加成
    public void holyRelicsTwoPieceSetBonus(Relics relics) {
        Integer twoEntryType = relics.getTwoEntryType();
        Double twoEntry = relics.getTwoEntry();
        if (twoEntryType == null) return;
        switch (twoEntryType) {
            case 2: {
                def_r += twoEntry;
                break;
            }
            case 3: {
                hp_p += twoEntry;
                break;
            }
            case 4: {
                atk_p += twoEntry;
                break;
            }
            case 5: {
                def_p += twoEntry;
                break;
            }
            case 6: {
                em_r += twoEntry;
                break;
            }
            case 7: {
                er_r += twoEntry;
                break;
            }
            case 8: {
                hsjc_r += twoEntry;
                break;
            }
            case 9: {
                ssjc_r += twoEntry;
                break;
            }
            case 10: {
                fsjc_r += twoEntry;
                break;
            }
            case 11: {
                lsjc_r += twoEntry;
                break;
            }
            case 12: {
                csjc_r += twoEntry;
                break;
            }
            case 13: {
                bsjc_r += twoEntry;
                break;
            }
            case 14: {
                ysjc_r += twoEntry;
                break;
            }
            case 15: {
                wsjc_r += twoEntry;
                break;
            }
            case 16: {
                crr_r += twoEntry;
                break;
            }
            case 17: {
                crd_r += twoEntry;
                break;
            }
            case 18: {
                hb_r += twoEntry;
                break;
            }
        }
    }

    //刷新所有值总量(初始)
    public void initRefreshTotal() {

        // 角色突破到90级的属性
        switch (as_t) {
            case 3: {
                hp_p += as_b;
                break;
            }
            case 4: {
                atk_p += as_b;
                break;
            }
            case 5: {
                def_p += as_b;
                break;
            }
            case 6: {
                em_r += as_b;
                break;
            }
            case 7: {
                er_r += as_b;
                break;
            }
            case 8: {
                hsjc_r += as_b;
                break;
            }
            case 9: {
                ssjc_r += as_b;
                break;
            }
            case 10: {
                fsjc_r += as_b;
                break;
            }
            case 11: {
                lsjc_r += as_b;
                break;
            }
            case 12: {
                csjc_r += as_b;
                break;
            }
            case 13: {
                bsjc_r += as_b;
                break;
            }
            case 14: {
                ysjc_r += as_b;
                break;
            }
            case 15: {
                wsjc_r += as_b;
                break;
            }
            case 16: {
                crr_r += as_b;
                break;
            }
            case 17: {
                crd_r += as_b;
                break;
            }
            case 18: {
                hb_r += as_b;
                break;
            }
        }

        this.hp_t = hp_b + hp_b * hp_p + hp_r;
        this.atk_t = atk_b + atk_b * atk_p + atk_r;
        this.def_t = def_b + def_b * def_p + def_r;
        this.em_t = em_b + em_b * em_p + em_r;
        this.ms_t = ms_b + ms_b * ms_p + ms_r;
        this.crr_t = crr_b + crr_b * crr_p + crr_r;
        this.crd_t = crd_b + crd_b * crd_p + crd_r;
        this.hb_t = hb_b + hb_b * hb_p + hb_r;
        this.ihb_t = ihb_b + ihb_b * ihb_p + ihb_r;
        this.er_t = er_b + er_b * er_p + er_r;
        this.cdr_t = cdr_b + cdr_b * cdr_p + cdr_r;
        this.ss_t = ss_b + ss_b * ss_p + ss_r;
        this.et_t = et_b + et_b * et_p + et_r;
        this.hsjc_t = hsjc_b + hsjc_b * hsjc_p + hsjc_r;
        this.ssjc_t = ssjc_b + ssjc_b * ssjc_p + ssjc_r;
        this.fsjc_t = fsjc_b + fsjc_b * fsjc_p + fsjc_r;
        this.lsjc_t = lsjc_b + lsjc_b * lsjc_p + lsjc_r;
        this.csjc_t = csjc_b + csjc_b * csjc_p + csjc_r;
        this.bsjc_t = bsjc_b + bsjc_b * bsjc_p + bsjc_r;
        this.ysjc_t = ysjc_b + ysjc_b * ysjc_p + ysjc_r;
        this.wsjc_t = wsjc_b + wsjc_b * wsjc_p + wsjc_r;
    }

    //刷新所有值总量
    public void RefreshTotal() {

        //计算前端加成
        this.hp_f = Double.parseDouble(String.format("%.5f", hp_b * hp_p + hp_r));
        this.atk_f = Double.parseDouble(String.format("%.5f", atk_b * atk_p + atk_r));
        this.def_f = Double.parseDouble(String.format("%.5f", def_b * def_p + def_r));

        //计算总量
        this.hp_t = Double.parseDouble(String.format("%.5f", hp_b + hp_b * hp_p + hp_r));
        this.atk_t = Double.parseDouble(String.format("%.5f", atk_b + atk_b * atk_p + atk_r));
        this.def_t = Double.parseDouble(String.format("%.5f", def_b + def_b * def_p + def_r));
        this.em_t = Double.parseDouble(String.format("%.5f", em_b + em_b * em_p + em_r));
        this.ms_t = Double.parseDouble(String.format("%.5f", ms_b + ms_b * ms_p + ms_r));
        this.crr_t = Double.parseDouble(String.format("%.5f", crr_b + crr_b * crr_p + crr_r));
        this.crd_t = Double.parseDouble(String.format("%.5f", crd_b + crd_b * crd_p + crd_r));
        this.hb_t = Double.parseDouble(String.format("%.5f", hb_b + hb_b * hb_p + hb_r));
        this.ihb_t = Double.parseDouble(String.format("%.5f", ihb_b + ihb_b * ihb_p + ihb_r));
        this.er_t = Double.parseDouble(String.format("%.5f", er_b + er_b * er_p + er_r));
        this.cdr_t = Double.parseDouble(String.format("%.5f", cdr_b + cdr_b * cdr_p + cdr_r));
        this.ss_t = Double.parseDouble(String.format("%.5f", ss_b + ss_b * ss_p + ss_r));
        this.et_t = Double.parseDouble(String.format("%.5f", et_b + et_b * et_p + et_r));
        this.hsjc_t = Double.parseDouble(String.format("%.5f", hsjc_b + hsjc_b * hsjc_p + hsjc_r));
        this.ssjc_t = Double.parseDouble(String.format("%.5f", ssjc_b + ssjc_b * ssjc_p + ssjc_r));
        this.fsjc_t = Double.parseDouble(String.format("%.5f", fsjc_b + fsjc_b * fsjc_p + fsjc_r));
        this.lsjc_t = Double.parseDouble(String.format("%.5f", lsjc_b + lsjc_b * lsjc_p + lsjc_r));
        this.csjc_t = Double.parseDouble(String.format("%.5f", csjc_b + csjc_b * csjc_p + csjc_r));
        this.bsjc_t = Double.parseDouble(String.format("%.5f", bsjc_b + bsjc_b * bsjc_p + bsjc_r));
        this.ysjc_t = Double.parseDouble(String.format("%.5f", ysjc_b + ysjc_b * ysjc_p + ysjc_r));
        this.wsjc_t = Double.parseDouble(String.format("%.5f", wsjc_b + wsjc_b * wsjc_p + wsjc_r));
    }

    //单人计算伤害
    public LinkedHashMap<String, Double> singleRoleComputing() {
        return new LinkedHashMap<>();
    }

    //伤害计算器（攻击倍率）
    public double damageCalculatorZF(
            double Magnification, //基础倍率（基础区）
            int elementalType, // 我方的元素类型（增伤区）
            int elementalTypeAtk, //我方攻击的元素（基础区）(反应区)
            int elementalTypeAtc, //敌方头上的元素（基础区）(反应区)
            double resistance, //敌方抗性（抗性区）
            int characterLevel, //角色等级（防御区）
            int enemyLevel //怪物等级（防御区）
    ) {
        //增幅反应
        if ((elementalTypeAtk == 8 && elementalTypeAtc == 9)
                || (elementalTypeAtk == 13 && elementalTypeAtc == 8)
                || (elementalTypeAtk == 9 && elementalTypeAtc == 8)
                || (elementalTypeAtk == 8 && elementalTypeAtc == 13)) {
            double damagevalue;//伤害数值
            damagevalue = foundationZone(Magnification) * injuryZone(elementalType) * reactionArea(elementalTypeAtk, elementalTypeAtc) * criticalZone() * resistanceZone(resistance) * defenseZone(characterLevel, enemyLevel);
            return damagevalue;
        }


        //激化反应
        if((elementalTypeAtk == 11 && elementalTypeAtc == 20)||(elementalTypeAtk == 12 && elementalTypeAtc == 20)){
            double damagevalue;//伤害数值
            damagevalue = foundationZone(Magnification,elementalTypeAtk,elementalTypeAtc) * injuryZone(elementalType) * criticalZone() * resistanceZone(resistance) * defenseZone(characterLevel, enemyLevel);
            return damagevalue;
        }


        //剧变反应（无碎冰）
        if(
                (elementalTypeAtk == 11 && elementalTypeAtc == 13)||(elementalTypeAtk == 13 && elementalTypeAtc == 11)|| // 超导反应
                (elementalTypeAtk == 10 && elementalTypeAtc == 8)||(elementalTypeAtk == 10 && elementalTypeAtc == 9)||  // 扩散反应
                (elementalTypeAtk == 10 && elementalTypeAtc == 11)||(elementalTypeAtk == 10 && elementalTypeAtc == 13)|| // 扩散反应
                (elementalTypeAtk == 8 && elementalTypeAtc == 11)||(elementalTypeAtk == 11 && elementalTypeAtc == 8)|| // 超载反应
                (elementalTypeAtk == 9 && elementalTypeAtc == 11)||(elementalTypeAtk == 11 && elementalTypeAtc == 9)|| // 感电反应
                (elementalTypeAtk == 8 && elementalTypeAtc == 12)||(elementalTypeAtk == 12 && elementalTypeAtc == 8) ||// 燃烧反应（引燃）
                (elementalTypeAtk == 12 && elementalTypeAtc == 21)// 燃烧反应（补草）
        ){
            double damagevalue;//伤害数值
            damagevalue =  reactionArea(elementalTypeAtk,elementalTypeAtc)*resistanceZone(resistance);
            return damagevalue;
        }

        //物理攻击
        if(elementalTypeAtc==19){
            double damagevalue;//伤害数值
            damagevalue = foundationZone(Magnification) * injuryZone(elementalType) * criticalZone() * resistanceZone(resistance) * defenseZone(characterLevel, enemyLevel);
            return damagevalue;
        }

        return 1;
    }

    //伤害计算器（生命倍率）
    public double damageCalculatorZFHp(
            double Magnification, //基础倍率（基础区）
            int elementalType, // 我方的元素类型（增伤区）
            int elementalTypeAtk, //我方攻击的元素（基础区）(反应区)
            int elementalTypeAtc, //敌方头上的元素（基础区）(反应区)
            double resistance, //敌方抗性（抗性区）
            int characterLevel, //角色等级（防御区）
            int enemyLevel //怪物等级（防御区）
    ) {
        //增幅反应
        if ((elementalTypeAtk == 8 && elementalTypeAtc == 9)
                || (elementalTypeAtk == 13 && elementalTypeAtc == 8)
                || (elementalTypeAtk == 9 && elementalTypeAtc == 8)
                || (elementalTypeAtk == 8 && elementalTypeAtc == 13)) {
            double damagevalue;//伤害数值
            damagevalue = foundationZoneHp(Magnification) * injuryZone(elementalType) * reactionArea(elementalTypeAtk, elementalTypeAtc) * criticalZone() * resistanceZone(resistance) * defenseZone(characterLevel, enemyLevel);
            return damagevalue;
        }


        //激化反应
        if((elementalTypeAtk == 11 && elementalTypeAtc == 20)||(elementalTypeAtk == 12 && elementalTypeAtc == 20)){
            double damagevalue;//伤害数值
            damagevalue = foundationZoneHp(Magnification,elementalTypeAtk,elementalTypeAtc) * injuryZone(elementalType) * criticalZone() * resistanceZone(resistance) * defenseZone(characterLevel, enemyLevel);
            return damagevalue;
        }


        //剧变反应（无碎冰）
        if(
                (elementalTypeAtk == 11 && elementalTypeAtc == 13)||(elementalTypeAtk == 13 && elementalTypeAtc == 11)|| // 超导反应
                        (elementalTypeAtk == 10 && elementalTypeAtc == 8)||(elementalTypeAtk == 10 && elementalTypeAtc == 9)||  // 扩散反应
                        (elementalTypeAtk == 10 && elementalTypeAtc == 11)||(elementalTypeAtk == 10 && elementalTypeAtc == 13)|| // 扩散反应
                        (elementalTypeAtk == 8 && elementalTypeAtc == 11)||(elementalTypeAtk == 11 && elementalTypeAtc == 8)|| // 超载反应
                        (elementalTypeAtk == 9 && elementalTypeAtc == 11)||(elementalTypeAtk == 11 && elementalTypeAtc == 9)|| // 感电反应
                        (elementalTypeAtk == 8 && elementalTypeAtc == 12)||(elementalTypeAtk == 12 && elementalTypeAtc == 8) ||// 燃烧反应（引燃）
                        (elementalTypeAtk == 12 && elementalTypeAtc == 21)// 燃烧反应（补草）
        ){
            double damagevalue;//伤害数值
            damagevalue =  reactionArea(elementalTypeAtk,elementalTypeAtc)*resistanceZone(resistance);
            return damagevalue;
        }

        //物理攻击
        if(elementalTypeAtc==19){
            double damagevalue;//伤害数值
            damagevalue = foundationZoneHp(Magnification) * injuryZone(elementalType) * criticalZone() * resistanceZone(resistance) * defenseZone(characterLevel, enemyLevel);
            return damagevalue;
        }

        return 1;
    }


    //基础区(攻击倍率)
    public double foundationZone(double Magnification) {
        return Magnification * atk_t;
    }

    //基础区(生命倍率)
    public double foundationZoneHp(double Magnification) {
        return Magnification * hp_t;
    }

    //基础区 激化反应
    public double foundationZone(double Magnification, int elementalTypeAtk, int elementalTypeAtc) {
        if (elementalTypeAtk == 11 && elementalTypeAtc == 20) {
            return Magnification * atk_t + 1447 * 1.15 * (1 + em_t * 5 / (1200 + em_t));
        }
        if (elementalTypeAtk == 12 && elementalTypeAtc == 20) {
            return Magnification * atk_t + 1447 * 1.25 * (1 + em_t * 5 / (1200 + em_t));
        }
        return 1.0;
    }

    //基础区 激化反应(生命倍率)
    public double foundationZoneHp(double Magnification, int elementalTypeAtk, int elementalTypeAtc) {
        if (elementalTypeAtk == 11 && elementalTypeAtc == 20) {
            return Magnification * hp_t + 1447 * 1.15 * (1 + em_t * 5 / (1200 + em_t));
        }
        if (elementalTypeAtk == 12 && elementalTypeAtc == 20) {
            return Magnification * hp_t + 1447 * 1.25 * (1 + em_t * 5 / (1200 + em_t));
        }
        return 1.0;
    }

    //增伤区
    public double injuryZone(int elementalType) {
        switch (elementalType) {
            case 8: {
                return 1.0 + hsjc_t;
            }
            case 9: {
                return 1.0 + ssjc_t;
            }
            case 10: {
                return 1.0 + fsjc_t;
            }
            case 11: {
                return 1.0 + lsjc_t;
            }
            case 12: {
                return 1.0 + csjc_t;
            }
            case 13: {
                return 1.0 + bsjc_t;
            }
            case 14: {
                return 1.0 + ysjc_t;
            }
            case 15: {
                return 1.0 + wsjc_t;
            }
        }
        return 1.0;
    }

    //反应区   elementalTypeAtk:我方攻击的元素    elementalTypeAtc：敌方头上的元素
    public double reactionArea(int elementalTypeAtk, int elementalTypeAtc) {
        //1.5增幅
        if ((elementalTypeAtk == 8 && elementalTypeAtc == 9) || (elementalTypeAtk == 13 && elementalTypeAtc == 8)) {
            return 1.5 * (2.78 * em_t) / (em_t + 1400);
        }
        //2.0增幅
        if ((elementalTypeAtk == 9 && elementalTypeAtc == 8) || (elementalTypeAtk == 8 && elementalTypeAtc == 13)) {
            return 2 * (2.78 * em_t) / (em_t + 1400);
        }
        //超导
        if ((elementalTypeAtk == 11 && elementalTypeAtc == 13)||(elementalTypeAtk == 13 && elementalTypeAtc == 11)) {
            return 1447*0.5*(1+(16*em_t)/(em_t+200));
        }
        //扩散
        if ((elementalTypeAtk == 10 && elementalTypeAtc == 8)||(elementalTypeAtk == 10 && elementalTypeAtc == 9)||(elementalTypeAtk == 10 && elementalTypeAtc == 11)||(elementalTypeAtk == 10 && elementalTypeAtc == 13)) {
            return 1447*0.6*(1+(16*em_t)/(em_t+200));
        }
        //超载
        if ((elementalTypeAtk == 8 && elementalTypeAtc == 11)||(elementalTypeAtk == 11 && elementalTypeAtc == 8)) {
            return 1447*2*(1+(16*em_t)/(em_t+200));
        }
        //感电
        if ((elementalTypeAtk == 9 && elementalTypeAtc == 11)||(elementalTypeAtk == 11 && elementalTypeAtc == 9)) {
            return 1447*2.4*(1+(16*em_t)/(em_t+200));
        }
        //燃烧
        if ((elementalTypeAtk == 8 && elementalTypeAtc == 12)||(elementalTypeAtk == 12 && elementalTypeAtc == 8)||(elementalTypeAtk == 12 && elementalTypeAtc == 21)) {
            return 1447*0.25*(1+(16*em_t)/(em_t+200));
        }
        return 1;
    }

    //暴击区
    public double criticalZone() {
        return 1.0 + crd_t * crr_t;
    }

    //抗性区
    public double resistanceZone(double resistance) {
        if (resistance < 0) {
            return 1 - resistance / 2;
        } else if (0 <= resistance && resistance <= 75) {
            return 1 - resistance;
        } else if (resistance > 75) {
            return 1 / (1 + 4 * resistance);
        }
        return 1;
    }

    //防御区
    public double defenseZone(int characterLevel, int enemyLevel) {
        return ((double) (characterLevel + 100) / ((characterLevel + 100) + (enemyLevel + 100)));
    }


    //普通攻击
    public void a0() {
    }

    public void a1() {
    }

    public void a2() {
    }

    public void a3() {
    }

    public void a4() {
    }

    public void a5() {
    }

    public void a6() {
    }

    public void a7() {
    }

    public void a8() {
    }

    public void a9() {
    }

    //重击
    public void z1() {
    }

    public void z2() {
    }

    public void z3() {
    }

    public void z4() {
    }

    public void z5() {
    }

    public void z6() {
    }

    public void z7() {
    }

    public void z8() {
    }

    public void z9() {
    }

    //下落攻击 1.下坠期间，2.低空下落，3.高空下落
    public void x1() {
    }

    public void x2() {
    }

    public void x3() {
    }

    public void x4() {
    }

    public void x5() {
    }

    public void x6() {
    }

    public void x7() {
    }

    public void x8() {
    }

    public void x9() {
    }

    //元素战技
    public void e1() {
    }

    public void e2() {
    }

    public void e3() {
    }

    public void e4() {
    }

    public void e5() {
    }

    public void e6() {
    }

    public void e7() {
    }

    public void e8() {
    }

    public void e9() {
    }

    //元素爆发
    public void q1() {
    }

    public void q2() {
    }

    public void q3() {
    }

    public void q4() {
    }

    public void q5() {
    }

    public void q6() {
    }

    public void q7() {
    }

    public void q8() {
    }

    public void q9() {
    }


}
